﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserPassWordEdit : GH.Web.BasePage.PageBase
{


    #region 画面初始化

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
          
        }
    }

    #endregion



    #region 画面事件

    protected void btnAdd_Click(object sender, ImageClickEventArgs e)
    {
        //原密码确认
        GH.BLL.User bllUser=new GH.BLL.User();
        System.Text.StringBuilder strWhere=new System.Text.StringBuilder();
        strWhere.AppendFormat(" ID={0}", this.UserID);
        strWhere.AppendFormat(" AND 登陆密码='{0}'",this.txtOldPassword.Text);

        System.Data.DataSet dsResult=bllUser.GetList(strWhere.ToString());
        if (dsResult.Tables[0].Rows.Count == 0)
        {
            AlertMessage("原密码输入不正确。");
        }
        //新密码对比
        if (this.txtNewPassword.Text != this.txtNewPasswordComfirm.Text)
        {
            AlertMessage("两次密码输入不一致，请确认。");
        }
        GH.Model.用户信息 mdUser = new GH.Model.用户信息();
        mdUser.ID = this.UserID;
        mdUser.登陆密码 = this.txtNewPassword.Text;
        bllUser.UpdatePassword(mdUser);
        AlertMessage("密码修改成功。");
    }

    #endregion
}
